{include file="public/header"/}
{load href="/public/static/Content/ThemesBusiness/FormPage.css"}

<div id="tabState" class="easyui-tabs" fit="true">
    <div title="新建">
        <form id="formState">
            <table class="form_table" style="width:860px">
                <tr class="form_tr">

                    <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                        管理员名称
                    </th>
                    <td style="width:155px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                        <input class="easyui-validatebox" type="text" validtype="workflowStateIsStart" name="username" style="width:150px;"
                               value="{$info.username}" data-options="required:true,tipPosition:'right'," />
                    </td>

                     <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                        真实姓名
                    </th>
                    <td style="width:155px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                        <input class="easyui-validatebox" type="text" validtype="workflowStateIsStart" name="realname" style="width:150px;"
                               value="{$info.realname}" data-options="required:true,tipPosition:'right'," />
                    </td>
                    <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                        排序
                    </th>
                    <td style="width:155px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                        <input class="easyui-numberspinner" min="0" type="text" name="sort" style="width:150px;"
                                value="{$info.sort}" data-options="required:true,tipPosition:'right'," />
                    </td>
                </tr>

                 <tr class="form_tr">

                 

                    <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                      所属组
                    </th>
                    <td style="width:155px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                        <select class="easyui-combobox"  name="group_id" data-options="required:true,tipPosition:'right'," style="">
                           
                            {volist name="$cate" id="vo"}
                            <option value="{$vo.id}" {if condition="$info.group_id eq $vo.id"} selected="selected" {/if}>{$vo.name}</option>
                            {/volist}
                        </select>
                    </td>

                    <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                        是否客服消息
                      </th>
                      <td style="width:155px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                          <select class="easyui-combobox"  name="is_kf" data-options="required:true,tipPosition:'right',">
                            <option value="0" {if condition="$info.is_kf eq 0"} selected="selected" {/if}>不接收客服消息</option>
                            <option value="1" {if condition="$info.is_kf eq 1"} selected="selected" {/if}>接收客服消息</option>
                          </select>
                      </td>


                        <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                        是否维修消息
                      </th>
                      <td style="width:155px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                          <select class="easyui-combobox"  name="is_wx" data-options="required:true,tipPosition:'right',">
                            <option value="0" {if condition="$info.is_wx eq 0"} selected="selected" {/if}>不接收维修消息</option>
                            <option value="1" {if condition="$info.is_wx eq 1"} selected="selected" {/if}>接收维修消息</option>
                          </select>
                      </td>


                </tr>

                <tr class="form_tr">
                    <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                        邮箱
                    </th>
                    <td style="width:155px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                        <input class="easyui-validatebox" type="text" validtype="workflowStateIsStart" name="email" style="width:150px;"
                               value="{$info.email}" data-options="required:true,tipPosition:'right'," />
                    </td>
                     <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                        手机号
                    </th>
                    <td style="width:155px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                        <input class="easyui-validatebox" type="text" validtype="workflowStateIsStart" name="telephone" style="width:150px;"
                               value="{$info.telephone}" data-options="required:true,tipPosition:'right'," />
                    </td>
                    
                       <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                      企业名称
                    </th>
                    <td style="width:155px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                        <select class="easyui-combobox"  name="company" data-options="required:true,tipPosition:'right'," style="">
                           
                            {volist name="$company" id="vo"}
                            <option value="{$vo.id}" {if condition="$info.company eq $vo.id"} selected="selected" {/if}>{$vo.name}</option>
                            {/volist}
                        </select>
                    </td>
                </tr>
               {empty name="$info.id"}
                    <tr class="form_tr">

                
                    <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                        密码
                    </th>
                    <td style="width:155px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                        <input class="easyui-validatebox" type="text" validtype="workflowStateIsStart" name="password" style="width:150px;"
                               value="" data-options="required:true,tipPosition:'right'," />
                    </td>
                 

                  
                </tr>
                  {/empty}

                    <!-- 隐藏域 -->
                    {notempty name="$info.id"}
                    <input type="hidden" name="id" value="{$info.id}">
                    {/notempty}
                 
                    <tr class="form_tr">
                        <td class="form_button_panel" colspan="6" style="padding-right:8px">
                        <!--  <span style="color:red;">数量限制设为0时表示不限制数量</span>  -->  <a  id="save" class="easyui-linkbutton form-toolbar-button" data-options="iconCls:'icon-save'">保存</a>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
<script>
   $(function() {
       $("#save").on("click",function(){
                $.ajax({
                       type: 'POST',
                       url: "{:url('admin/user/save')}",
                       data:  $("#formState").serialize(),
                       dataType: "json",
                       async: false,
                    error: function(request) {
                        alert("发送请求失败！");
                    },
                   success: function(data){
                        if (data.status == 1) {          
                                closeRefreshDialog();
                              //closeDialog();
                        } else {
                            $.messager.alert('提示', data.msg, 'error');
                           // return;
                           // alert(data.msg);
                    
                        }
                       
                    } 
                });
       })
    })

   
</script>

{include file="public/footer"/}